package com.kkk.shop.goods.service.impl;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.kkk.shop.common.service.impl.BaseServiceImpl;
import com.kkk.shop.common.util.ConstantFinalUtil;
import com.kkk.shop.common.util.PageInfoUtil;
import com.kkk.shop.goods.dao.IGoodsBrandDao;
import com.kkk.shop.goods.dao.IGoodsCateDao;
import com.kkk.shop.goods.dao.IGoodsDao;
import com.kkk.shop.goods.pojo.AGoods;
import com.kkk.shop.goods.pojo.AGoodsBrand;
import com.kkk.shop.goods.pojo.AGoodsCate;
import com.kkk.shop.goods.service.IGoodsService;

/**
 * 商品品牌的服务实现
 * @author kkk
 * */
@Service("goodsService")
public class GoodsServiceImpl extends BaseServiceImpl implements IGoodsService
{
	@Resource
	private IGoodsBrandDao goodsBrandDao;
	@Resource
	private IGoodsCateDao goodsCateDao;
	@Resource
	private IGoodsDao goodsDao;

	/*----商品品牌服务实现开始----*/
	@Override
	public JSONObject insertOneAGoodsBrandService(AGoodsBrand goodsBrand)
	{
		JSONObject resultJSON=new JSONObject();
		int res=this.goodsBrandDao.insertOne(goodsBrand);
		if(res>0)
		{
			resultJSON.put("code", "0");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.getString("0"));
			JSONObject dataJSON=new JSONObject();
			dataJSON.put("id", goodsBrand.getId()+"");
			dataJSON.put("effect", res);
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "1");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.getString("1"));
		}
		return resultJSON;
	}
	
	@Override
	public JSONObject insertOneAGoodsBrandService(Map<String,Object> paramMap,AGoodsBrand goodsBrand)
	{
		/* 保存品牌 */
		JSONObject resultJSON = this.insertOneAGoodsBrandService(goodsBrand);
		if("0".equalsIgnoreCase(resultJSON.getString("code")))
		{
			/* 保存品牌成功 */
			/*
			 * 上传图片:
			路径
			网络路径:http://127.0.0.1:8080/shop_back/uploadfile/brand/2017-02-13/uuid.jpg
			真实路径:d:/project/shop_back/uploadfile/brand/2017-02-13/uuid.jpg
			相对路径:/uploadfile/brand/2017-02-13/uuid.jpg
			 * */
			/* 原始文件的名称 "null" */
			String oriFileName = paramMap.get("oriFileName") + "";
			InputStream inputStream = (InputStream) paramMap.get("inputStream");
			
			if(paramMap.get("oriFileName") != null && !"".equalsIgnoreCase(oriFileName))
			{
				/* 相对路径 */
				String relaPath = ConstantFinalUtil.BUNDLE.getString("file.relaPath");
				relaPath += "/brand/" + this.dateFormatUtil.formatDate(new Date()) + "/" + UUID.randomUUID().toString().replaceAll("-", "") 
						+ oriFileName.substring(oriFileName.lastIndexOf("."), oriFileName.length());
				/* 真实路径 */
				String truePath = ConstantFinalUtil.BUNDLE.getString("file.truePath") + relaPath;
				File tarFile = new File(truePath);
				try
				{
					/* 父目录不存在 */
					if(!tarFile.getParentFile().exists())
					{
						tarFile.getParentFile().mkdirs() ; 
					}
					FileOutputStream fos = new FileOutputStream(tarFile);
					/* 文件拷贝 */
					if(!this.fileUtil.copyFile(inputStream, fos))
					{
						ConstantFinalUtil.loggerMsg.error("拷贝文件失败了," ,tarFile);
						/* 拷贝文件失败,抛异常 */
						String str = null ; 
						str.toString() ; 
					}else
					{
						goodsBrand.setLogoPath(relaPath);
						this.updateOneAGoodsBrandService(goodsBrand);
					}
				} catch (FileNotFoundException e)
				{
				}
			}
		}
		return resultJSON;
	}

	@Override
	public JSONObject updateOneAGoodsBrandService(AGoodsBrand goodsBrand)
	{
		JSONObject resultJSON=new JSONObject();
		int res=this.goodsBrandDao.updateOne(goodsBrand);
		if(res>0)
		{
			resultJSON.put("code","0");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.getString("0"));
			JSONObject dataJSON=new JSONObject();
			dataJSON.put("id", goodsBrand.getId()+"");
			dataJSON.put("effect", res);
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "2");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.getString("2"));
		}
		return resultJSON;
	}
	
	@Override
	public JSONObject updateOneAGoodsBrandService(Map<String,Object> paramMap,AGoodsBrand goodsBrand)
	{
		JSONObject resultJSON=this.updateOneAGoodsBrandService(goodsBrand);
		if("0".equalsIgnoreCase(resultJSON.getString("code")))
		{
			/* 更新品牌成功 */
			/*
			 * 上传图片:
			路径
			网络路径:http://127.0.0.1:8080/shop_back/uploadfile/brand/2017-02-13/uuid.jpg
			真实路径:d:/project/shop_back/uploadfile/brand/2017-02-13/uuid.jpg
			相对路径:/uploadfile/brand/2017-02-13/uuid.jpg
			 * */
			/* 原始文件的名称 "null" */
			String oriFileName=paramMap.get("oriFileName")+"";
			InputStream inputStream=(InputStream) paramMap.get("inputStream");
			if(paramMap.get("oriFileName")!=null &&!"".equalsIgnoreCase(oriFileName))
			{
				//更新成功时要把旧文件删除:从数据库取出来的,实际是logo的相对路径
				String oldPath=goodsBrand.getLogoPath();
				File oldFile=new File(ConstantFinalUtil.BUNDLE.getString("file.truePath")+oldPath);
				//相对路径
				String relaPath=ConstantFinalUtil.BUNDLE.getString("file.relaPath");
				relaPath+="/brand/"+this.dateFormatUtil.formatDate(new Date())+"/"+UUID.randomUUID().toString().replaceAll("-","")+
						oriFileName.substring(oriFileName.lastIndexOf("."), oriFileName.length());
				//真实路径
				String truePath=ConstantFinalUtil.BUNDLE.getString("file.truePath")+relaPath;
				File tarFile=new File(truePath);
				try
				{
					//父目录不存在
					if(!tarFile.getParentFile().exists())
					{
						tarFile.getParentFile().mkdirs();
					}
					FileOutputStream fos=new FileOutputStream(tarFile);
					//文件拷贝
					if(!this.fileUtil.copyFile(inputStream, fos))
					{
						ConstantFinalUtil.loggerMsg.error("拷贝文件失败了,",tarFile);
						String str=null;
						str.toString();
					}else
					{
						//实际存到数据库中
						goodsBrand.setLogoPath(relaPath);
						JSONObject resDBJSON=this.updateOneAGoodsBrandService(goodsBrand);
						if("0".equalsIgnoreCase(resDBJSON.getString("code")))
						{
							//拷贝新文件成功,删除旧的文件
							if(oldFile.exists())
							{
								//如果文件删除失败,则给出错误提示
								if(!oldFile.delete())
								{
									ConstantFinalUtil.loggerMsg.error("删除品牌旧的logo失败了,路径{},",oldFile);
								}
							}
						}
					}
				} catch (IOException e)
				{
				}
			}
		}
		return resultJSON;
	}

	@Override
	public JSONObject deleteOneAGoodsBrandService(AGoodsBrand goodsBrand)
	{
		JSONObject resultJSON=new JSONObject();
		int res=this.goodsBrandDao.deleteOne(goodsBrand);
		if(res>0)
		{
			resultJSON.put("code", "0");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.getString("0"));
			JSONObject dataJSON=new JSONObject();
			dataJSON.put("id", goodsBrand.getId()+"");
			dataJSON.put("effect", res);
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "3");
			resultJSON.put("info",ConstantFinalUtil.INFO_JSON.getString("3"));
		}
		return resultJSON;
	}

	@Override
	public AGoodsBrand queryOneAGoodsBrandService(Map<String, Object> paramMap)
	{
		return this.goodsBrandDao.queryOne(paramMap);
	}

	@Override
	public List<AGoodsBrand> queryMultiAGoodsBrandService(PageInfoUtil pageInfoUtil, Map<String, Object> paramMap)
	{
		if(paramMap.get("keywords")!=null && !"".equalsIgnoreCase(paramMap.get("keywords")+""))
		{
			paramMap.put("keywords", "%"+paramMap.get("keywords")+"%");
		}
		if(pageInfoUtil!=null)
		{
			//分页查询,先查总记录数,然后在查分页的结果
			paramMap.put("pageCond", "true");
			List<AGoodsBrand> goodsBrandList=this.goodsBrandDao.queryMulti(paramMap);
			//取总记录数
			if(goodsBrandList.size()==1)
			{
				//因为总记录数在mapper中已经保存到id字段中,所以可以直接取id作为总记录数的值
				pageInfoUtil.setTotalRecord(goodsBrandList.get(0).getId());
			}
			//查询分页
			paramMap.put("pageCond", "false");
			paramMap.put("currentRecord",pageInfoUtil.getCurrentRecord());
			paramMap.put("pageSize", pageInfoUtil.getPageSize());
			return this.goodsBrandDao.queryMulti(paramMap);
		}
		//不分页查询总记录
		return this.goodsBrandDao.queryMulti(paramMap);
	}
	/*----商品品牌服务实现结束----*/
	
	/*----商品服务实现开始----*/
	@Override
	public JSONObject insertOneGoodsService(AGoods goods)
	{
		JSONObject resultJSON = new JSONObject();
		/* 影响条数 */
		int res = this.goodsDao.insertOne(goods);
		/*String str = null ; 
		str.toString();*/
		if(res > 0 )
		{
			resultJSON.put("code", "0");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.get("0"));
			
			/* 存储data */
			JSONObject dataJSON = new JSONObject();
			dataJSON.put("id", goods.getId() + "");
			dataJSON.put("effect", res + "");
			
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "1");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.get("1"));
		}
		return resultJSON;
	}
	
	public JSONObject insertOneGoodsService(Map<String,Object> paramMap,AGoods goods)
	{
		//注意!先保存部分字段,需要把数据库中的部分字段改为不是必须的
		JSONObject resultJSON=this.insertOneGoodsService(goods);
		if("0".equalsIgnoreCase(resultJSON.getString("code")))
		{
			/* 保存品牌成功 */
			/*
			 * 上传图片:
			路径
			网络路径:http://127.0.0.1:8080/shop_back/uploadfile/brand/2017-02-13/uuid.jpg
			真实路径:d:/project/shop_back/uploadfile/brand/2017-02-13/uuid.jpg
			相对路径:/uploadfile/brand/2017-02-13/uuid.jpg
			 * */
			/* 原始文件的名称 "null" */
			String oriFileName=paramMap.get("oriFileName")+"";
			InputStream inputStream=(InputStream) paramMap.get("inputStream");
			if(paramMap.get("oriFileName")!=null && !"".equalsIgnoreCase(oriFileName))
			{
				//先获取web项目内部存放图片的路劲如uploadfile
				String relaPath=ConstantFinalUtil.BUNDLE.getString("file.relaPath");
				relaPath+="/goods/"+this.dateFormatUtil.formatDate(new Date())+"/"+UUID.randomUUID().toString().replaceAll("-", "")
						+oriFileName.substring(oriFileName.lastIndexOf("."),oriFileName.length());
				//拼接成真正在硬盘中存放的路径
				String truePath=ConstantFinalUtil.BUNDLE.getString("file.truePath")+relaPath;
				File tarFile=new File(truePath);
				
				try
				{
					//父目录不存在的话,就创建
					if(!tarFile.exists())
					{
						tarFile.getParentFile().mkdirs();
					}
					FileOutputStream fos=new FileOutputStream(tarFile);
					
					//文件拷贝
					if(!this.fileUtil.copyFile(inputStream, fos))
					{
						ConstantFinalUtil.loggerMsg.error("---拷贝文件失败了,-{}-",tarFile);
						String str=null;
						str.toString();
					}else
					{
						goods.setListImgPath(relaPath);
						this.updateOneGoodsService(goods);
					}
				} catch (FileNotFoundException e)
				{
				}
			}
		}
		
		return resultJSON;
	}

	@Override
	public JSONObject updateOneGoodsService(AGoods goods)
	{
		JSONObject resultJSON = new JSONObject();
		/* 影响条数 */
		int res = this.goodsDao.updateOne(goods);
		/*String str = null ; 
		str.toString();*/
		if(res > 0 )
		{
			resultJSON.put("code", "0");
			resultJSON.put("info", "成功");
			
			/* 存储data */
			JSONObject dataJSON = new JSONObject();
			dataJSON.put("id", goods.getId() + "");
			dataJSON.put("effect", res + "");
			
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "2");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.get("2"));
		}
		return resultJSON;
	}

	@Override
	public JSONObject deleteOneGoodsService(AGoods goods)
	{
		JSONObject resultJSON = new JSONObject();
		/* 影响条数 */
		int res = this.goodsDao.deleteOne(goods);
		/*String str = null ; 
		str.toString();*/
		if(res > 0 )
		{
			resultJSON.put("code", "0");
			resultJSON.put("info", "成功");
			
			/* 存储data */
			JSONObject dataJSON = new JSONObject();
			dataJSON.put("id", goods.getId() + "");
			dataJSON.put("effect", res + "");
			
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "3");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.get("3"));
		}
		return resultJSON;
	}

	@Override
	public AGoods queryOneGoodsService(Map<String, Object> paramMap)
	{
		return this.goodsDao.queryOne(paramMap);
	}

	@Override
	public List<AGoods> queryMultiGoodsService(PageInfoUtil pageInfoUtil, Map<String, Object> paramMap)
	{
		/**
		 * 先从redis中取数据,如果能取到,就直接从redis取数据,
		 * 放的数据:分页信息+数据
		 * {"pageInfoUtil":{},"goodsList":{}}
		 * 取不到数据时,再从数据库取数据
		 * key不能重复:列表的条件
		 * */
		String redisKey="goodsList_pageInfo-"+pageInfoUtil.getCurrentPage()+"_cond-"+paramMap;
		String goodsListStr=this.redisUtil.get(redisKey)+"";
		if(!"".equalsIgnoreCase(goodsListStr) && !"null".equalsIgnoreCase(goodsListStr))
		{
			//将取到的字符串转为json
			JSONObject dataJSON=JSON.parseObject(goodsListStr);
			//取出分页
			if(pageInfoUtil==null)
			{
				pageInfoUtil=new PageInfoUtil();
			}
			//此处必须使用get,不能使用getString,否则无法转JSONObject
			pageInfoUtil=pageInfoUtil.parseJSON((JSONObject)dataJSON.get("pageInfo"));
			//redis已有数据
			List<AGoods> goodsList=new ArrayList<AGoods>();
			JSONArray goodsArr=dataJSON.getJSONArray("goodsList");
			for(Iterator it=goodsArr.iterator();it.hasNext();)
			{
				JSONObject goodsJSON=(JSONObject) it.next();
				AGoods goods=new AGoods();
				goods=goods.parseJSON(goodsJSON);
				goodsList.add(goods);
			}
			return goodsList;
		}
		
		//为关键字加上%进行模糊匹配
		if(paramMap.get("keywords")!=null && !"".equalsIgnoreCase(paramMap.get("keywords")+""))
		{
			paramMap.put("keywords", "%"+paramMap.get("keywords")+"%");
		}
		if(pageInfoUtil!=null)
		{
			//分页查询,先查总记录数,然后在查分页的结果
			paramMap.put("pageCond", "true");
			List<AGoods> goodsBrandList=this.goodsDao.queryMulti(paramMap);
			//取总记录数
			if(goodsBrandList.size()==1)
			{
				//因为总记录数在mapper中已经保存到id字段中,所以可以直接取id作为总记录数的值
				pageInfoUtil.setTotalRecord(goodsBrandList.get(0).getId());
			}
			//查询分页
			paramMap.put("pageCond", "false");
			paramMap.put("currentRecord",pageInfoUtil.getCurrentRecord());
			paramMap.put("pageSize", pageInfoUtil.getPageSize());
			List<AGoods> goodsList=this.goodsDao.queryMulti(paramMap);
			//新查询得到的数据马上写到redis中
			JSONObject dataJSON=new JSONObject();
			dataJSON.put("pageInfo",pageInfoUtil.toJSON());
			
			JSONArray goodsArr=new JSONArray();
			for(Iterator it=goodsList.iterator();it.hasNext();) 
			{
				AGoods goods=(AGoods) it.next();
				goodsArr.add(goods.toJSON());
			}
			dataJSON.put("goodsList",goodsArr);
			//放的数据都需要设置过期时间,避免无用数据占用过多的资源
			this.redisUtil.put(redisKey,dataJSON.toJSONString(),60*2);
			return goodsList;
		}
		//不分页查询总记录
		List<AGoods> goodsList=this.goodsDao.queryMulti(paramMap);
		return goodsList;
	}
	
	/**
	 * 查询整棵树
	 *  [
		{ id:1, pId:0, name:"一级分类", open:true},
		{ id:11, pId:1, name:"二级分类",file=''},
		{ id:111, pId:11, name:"三级分类","file":"http://www.baidu.com"},
		{ id:112, pId:11, name:"三级分类"},
		{ id:113, pId:11, name:"三级分类"},
		{ id:114, pId:11, name:"三级分类"},
		{ id:115, pId:11, name:"三级分类"},
		{ id:12, pId:1, name:"二级分类 1-2"},
		{ id:121, pId:12, name:"三级分类 1-2-1"},
		{ id:122, pId:12, name:"三级分类 1-2-2"},
		]
	 * */
	public JSONArray queryTreeGoodsCateService(List<AGoodsCate> goodsCateList,String rootPath)
	{
		JSONArray resultArr=new JSONArray();
		for (Iterator iterator = goodsCateList.iterator(); iterator.hasNext();)
		{
			AGoodsCate goodsCate = (AGoodsCate) iterator.next();
			/* 拼装数据 */
			this.queryTreeGoodsServiceUtil(resultArr, goodsCate,rootPath,0);
		}
		return resultArr;
	}

	private void queryTreeGoodsServiceUtil(JSONArray resultArr,AGoodsCate goodsCate,String rootPath,int level)
	{
		if(goodsCate!=null)
		{
			StringBuffer sb=new StringBuffer();
			for(int i=0;i<level;i++)
			{
				sb.append("|-->");
			}
			/*|-->|-->|-->国产品牌*/
			goodsCate.setTreeName(sb.toString()+goodsCate.getName());
			JSONObject goodsCateJSON=new JSONObject();
			goodsCateJSON.put("id", goodsCate.getId() + "");
			goodsCateJSON.put("pId", goodsCate.getParentId() + "");
			goodsCateJSON.put("name", goodsCate.getName() + "");
			goodsCateJSON.put("treeName", goodsCate.getTreeName() + "");
			goodsCateJSON.put("spec", goodsCate.getSpec() + "");
			goodsCateJSON.put("open", "true");
			//只有叶子节点才能点击
			if(goodsCate.getChildCateList().size()==0)
			{
				//rootpath由controller获得
				goodsCateJSON.put("file",rootPath+"/back/goods/cateUpdate.html?cid="+goodsCate.getId());
				goodsCateJSON.put("isLeaf", "1");
			}else
			{
				goodsCateJSON.put("isLeaf", "0");
			}
			resultArr.add(goodsCateJSON);
			if(goodsCate.getChildCateList().size()>0)
			{
				for (Iterator iterator = goodsCate.getChildCateList().iterator(); iterator.hasNext();)
				{
					AGoodsCate goodsCateChild=(AGoodsCate) iterator.next();
					this.queryTreeGoodsServiceUtil(resultArr, goodsCateChild,rootPath, level + 1);
				}
			}
		}
	}
	/*----商品服务实现结束----*/
	
	/*----商品分类服务实现开始----*/
	@Override
	public JSONObject insertOneGoodsCateService(AGoodsCate goodsCate)
	{
		JSONObject resultJSON = new JSONObject();
		/* 影响条数 */
		int res = this.goodsCateDao.insertOne(goodsCate);
		/*String str = null ; 
		str.toString();*/
		if(res > 0 )
		{
			resultJSON.put("code", "0");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.get("0"));
			
			/* 存储data */
			JSONObject dataJSON = new JSONObject();
			dataJSON.put("id", goodsCate.getId() + "");
			dataJSON.put("effect", res + "");
			
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "1");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.get("1"));
		}
		return resultJSON;
	}

	@Override
	public JSONObject updateOneGoodsCateService(AGoodsCate goodsCate)
	{
		JSONObject resultJSON = new JSONObject();
		/* 影响条数 */
		int res = this.goodsCateDao.updateOne(goodsCate);
		/*String str = null ; 
		str.toString();*/
		if(res > 0 )
		{
			resultJSON.put("code", "0");
			resultJSON.put("info", "成功");
			
			/* 存储data */
			JSONObject dataJSON = new JSONObject();
			dataJSON.put("id", goodsCate.getId() + "");
			dataJSON.put("effect", res + "");
			
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "2");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.get("2"));
		}
		return resultJSON;
	}

	@Override
	public JSONObject deleteOneGoodsCateService(AGoodsCate goodsCate)
	{
		JSONObject resultJSON = new JSONObject();
		/* 影响条数 */
		int res = this.goodsCateDao.deleteOne(goodsCate);
		/*String str = null ; 
		str.toString();*/
		if(res > 0 )
		{
			resultJSON.put("code", "0");
			resultJSON.put("info", "成功");
			
			/* 存储data */
			JSONObject dataJSON = new JSONObject();
			dataJSON.put("id", goodsCate.getId() + "");
			dataJSON.put("effect", res + "");
			
			resultJSON.put("data", dataJSON);
		}else
		{
			resultJSON.put("code", "3");
			resultJSON.put("info", ConstantFinalUtil.INFO_JSON.get("3"));
		}
		return resultJSON;
	}

	@Override
	public AGoodsCate queryOneGoodsCateService(Map<String, Object> paramMap)
	{
		return this.goodsCateDao.queryOne(paramMap);
	}

	@Override
	public List<AGoodsCate> queryMultiGoodsCateService(PageInfoUtil pageInfoUtil, Map<String, Object> paramMap)
	{
		if(paramMap.get("keywords")!=null && !"".equalsIgnoreCase(paramMap.get("keywords")+""))
		{
			paramMap.put("keywords", "%"+paramMap.get("keywords")+"%");
		}
		if(pageInfoUtil!=null)
		{
			//分页查询,先查总记录数,然后在查分页的结果
			paramMap.put("pageCond", "true");
			List<AGoods> goodsBrandList=this.goodsDao.queryMulti(paramMap);
			//取总记录数
			if(goodsBrandList.size()==1)
			{
				//因为总记录数在mapper中已经保存到id字段中,所以可以直接取id作为总记录数的值
				pageInfoUtil.setTotalRecord(goodsBrandList.get(0).getId());
			}
			//查询分页
			paramMap.put("pageCond", "false");
			paramMap.put("currentRecord",pageInfoUtil.getCurrentRecord());
			paramMap.put("pageSize", pageInfoUtil.getPageSize());
			return this.goodsCateDao.queryMulti(paramMap);
		}
		//不分页查询总记录
		return this.goodsCateDao.queryMulti(paramMap);
	}
	/*----商品分类服务实现结束----*/

}
